{% extends "base.html" %}
{% load humanize %}
{% load nightly_tags %}

{% block pagetitle %} Latest Nightlies: {% endblock %}

{% block content %}

    {% if latest %}

        <ul id="snapshots">
        {% for night in latest %}
            <li>
                <ul>
                    <li class="head">
                        {{ night.snapshot_time|date:"l, d F Y" }}
                            ({{ night.snapshot_time|timesince }} ago)
                    </li>
                    <li class="subhead">
                        Snapshot of r{{ night.revision|escape }}, with
                        {{ night.changes|intcomma }} change{{ night.changes|pluralize }} 
                        since the previous snapshot:
                    </li>
                
                    <li>
                        <ul class="changes">
                            {% for change in night.log_set.all %}
                                <li> 
                                    [<a href="{{ change.revision|link_changeset }}"
                                        >{{ change.revision|escape }}</a>]
                                        {{ change.author|escape }}:
                                            {{ change.msg|truncatewords:30|escape }}
                                </li>
                        {% endfor %}
                        </ul>
                    </li>
                    <li class="download">
                        <a href="{{ night.get_absolute_url|escape }}"
                                >download {{ night.filename|escape }} 
                                ({{ night.filesize|filesizeformat }})
                        </a>
                        
                        <span class="hash">(MD5: {{ night.filehash|escape }})</span>
                    </li>
                </ul>
            </li>
        {% endfor %}
        </ul>
    {% else %}
        <p>No nightlies yet, try tomorrow.</p>
    {% endif %}

{% endblock %}